From d815b1bc7820f551cf36b4573bdf68e2c2606002 Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Thu, 8 Aug 2013 02:34:34 +0000 Subject: [PATCH] fix strip_html leak again, it looks like r4508 lost r4504 in a bad merge. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4522 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/util.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gpsbabel/util.cc b/gpsbabel/util.cc index 1ee7969ef..a75523c84 100644 --- a/gpsbabel/util.cc +++ b/gpsbabel/util.cc @@ -1561,10 +1561,11 @@ char * strip_html(const utf_string *in) { char* outstring, *out; - char* instr = xstrdup(CSTR(in->utfstring)); + char* incopy, *instr; char tag[8]; unsigned short int taglen = 0; + incopy = instr = xstrdup(CSTR(in->utfstring)); if (!in->is_html) { return instr; } @@ -1634,6 +1635,9 @@ strip_html(const utf_string *in) instr++; } *out++ = 0; + if (incopy) { + xfree(incopy); + } return (outstring); } -- 2.30.2